/**
 * OPay Inc.
 * Copyright (c) 2016-2022 All Rights Reserved.
 */
package cc.dd.marketing.api.constant;

import lombok.Data;

import java.io.Serializable;

/**
 * @author sufeng.dong
 * @version $Id: ResultDTO.java, v 0.1 2022-09-08 5:45 PM sufeng.dong Exp $$
 */
@Data
public class ResultDTO<T> implements Serializable {
    /**
     * 请求是否成功
     */
    private Boolean success;
    /**
     * 错误编码
     */
    private String code;
    /**
     * 错误信息
     */
    private String message;
    /**
     * 业务返回值
     */
    private T data;

    public static boolean isResultSuccess(ResultDTO result) {
        return null != result && result.getSuccess();
    }
}
